#define PURPLE_PLUGINS

#include "account.h"
#include "accountopt.h"
#include "debug.h"
#include "notify.h"
#include "request.h"
#include "server.h"
#include "util.h"
#include "version.h"
#include "xmlnode.h"
#include "avatar.h"

#include "tlen.h"

/** 
 * @brief Handles 'avatar' node we get after logging in.
 *        Sets avatar_token in the the TlenSession
 * 
 * @param tlen 
 * @param xml 
 * 
 * @return 
 */
int tlen_process_avatar(TlenSession *tlen, xmlnode *xml)
{
#if 0
	xmlnode *token_tag;
	char *token;
	purple_debug_info("tlen", "tlen_process_avatar");

	token_tag = xmlnode_get_child(xml, "token");
	// No token or tag empty?
	if (token_tag == NULL) {
		return 0;
	}

	token = xmlnode_get_data(token_tag);
	if (token == NULL) {
		return 0;
	}

	// Already have a token?
	if (tlen->avatar_token != NULL) {
		g_free(tlen->avatar_token);
	}

	// Don't need to strdup the token, since xmlnode_get_data returns
	// a new string
	tlen->avatar_token = token;

	purple_debug_info("tlen", "new token: %s", tlen->avatar_token);

#endif
	return 0;
}
